import { Good } from '@/modules/businessModule/good/assets/good.entity';
import { UserClient } from '@/modules/businessModule/userClient/assets/userClient.entity';
import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
export class Seat {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'bigint', nullable: true })
  @ApiProperty({ type: 'bigint', description: '购买时间' })
  seatBuyTime?: number;

  @Column({ type: 'bigint', nullable: true })
  @ApiProperty({ type: 'bigint', description: '过期时间' })
  invalidTime?: number;

  @ApiProperty({ description: '物品', type: () => Good })
  @ManyToOne(() => Good, (good) => good.seats)
  good: Good;

  @ApiProperty({ description: '用户', type: () => UserClient })
  @ManyToOne(() => UserClient)
  userClient: UserClient;
}
